-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ref(react-router): Deprecate ErrorBoundary exports #18208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The ErrorBoundary exported in the SDK only works on the client and is not intended to be used. Use react router's error boundary instead: https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries
| /** | ||
| * @deprecated ErrorBoundaryProps and FallbackRender are deprecated, use react router's error boundary instead. | ||
| * See https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Deprecation Paradox: API Surface Expansion (Bugbot Rules)
This change introduces new public API exports for ErrorBoundaryProps and FallbackRender types that were not previously exported from this package. While marked as deprecated, adding new exports contradicts the PR's intention to deprecate ErrorBoundary functionality. If these types weren't needed before, exporting them now (even as deprecated) expands the public API surface unnecessarily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were exported before...
| export { captureReactException, reactErrorHandler, Profiler, withProfiler, useProfiler } from '@sentry/react'; | ||
|
|
||
| /** | ||
| * @deprecated ErrorBoundary is deprecated, use react router's error boundary instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @deprecated ErrorBoundary is deprecated, use react router's error boundary instead. | |
| * @deprecated ErrorBoundary is deprecated, use React Router's error boundary instead. |
Looks a bit more professional if we use the official name in the public exports (same as below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will ammend
The ErrorBoundary exported in the SDK only works on the client and is not intended to be used.
Use react router's error boundary instead: https://docs.sentry.io/platforms/javascript/guides/react-router/#report-errors-from-error-boundaries.